package com.shu.jdk;

/**
 * @author ssm
 * @version V1.0
 * @description:
 * @date 2021/8/19 20:48
 */

public class LoopTest {

    public static void main(String[] args) {

        for (int i = 0; i < 10; i++) {
            if (i == 5) {
                continue;
            } else {
                System.out.println(i);
            }
        }

        System.out.println("2-------------");

        for (int i = 0; i < 10; i++) {
            if (i == 5) {
                break;
            } else {
                System.out.println(i);
            }
        }

        System.out.println("3-------------");

        for (int i = 0; i < 10; i++) {
            for (int i1 = 0; i1 < 10; i1++) {
                if (i == 5) {
                    break;
                } else {
                    System.out.println(i);
                }
            }
        }


        System.out.println("跳出双重循环-------------");
        ok:
        for (int i = 0; i < 10; i++) {
            for (int i1 = 0; i1 < 10; i1++) {
                if (i == 5) {
                    break ok;
                } else {
                    System.out.println(i);
                }
            }
        }

    }


}
